﻿Imports extranet.BC
Imports extranet.BE
Imports MetodosComuns


Partial Class forum_adm_pendentes
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objBESeguranca As New BESeguranca
        Dim objBEUsuario As BEUsuario = Session("objBEUsuario")

        If IsNothing(objBEUsuario) Then Response.Redirect(TELA_LOGOUT)
        Session("strTela") = MetodosComuns.GetCurrentPageName()
        If Not IsPostBack Then          ' SEGURANÇA
            objBESeguranca = BCSeguranca.SelecionaPermissoes(objBEUsuario.GrupoAcesso, Session("strTela"))
            If Not objBESeguranca.Autorizado Then Response.Redirect(TELA_LOGOUT)
            Session("objBESeguranca") = objBESeguranca
        Else
            objBESeguranca = Session("objBESeguranca")
        End If

        If objBESeguranca.Escrita Then 'Verificar aki se usuário tem permissao de administrador
            If Not IsPostBack Then
                GridView1.DataSource = BCForum.ListaPostsPendentes()
                GridView1.DataBind()

                GridView2.DataSource = BCForum.ListaTopicosPendentes()
                GridView2.DataBind()
            End If
        Else
            Response.Redirect(TELA_LOGOUT)
        End If
    End Sub

    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
        Response.Redirect("adm_forum_inicial.aspx")
    End Sub
End Class
